/**
 * Created by tdzl2003 on 8/24/16.
 */
import {Component} from 'react';

const originSetState = Component.prototype.setState;

Component.prototype.setState = function(newState, callback) {
  const ret = new Promise(resolve => originSetState.call(this, newState, resolve));
  if (callback) {
    ret.then(callback);
  }
  return ret;
};
